
class TypeConst {
    public static void main(String[] args) {
        String s1 = "Hello";
        String s2 = "Hello";
        System.out.println(s1 == s2);
        System.out.println(s1.equals(s2));

        System.out.println("---------------------------");

        String s3 = new String("Hello");
        String s4 = new String("Hello");
        System.out.println(s3 == s4);
        System.out.println(s3.equals(s4));

        System.out.println("---------------------------");
        
        Integer i1 = 100;
        Integer i2 = 100;
        System.out.println(i1 == i2);
        System.out.println(i1.equals(i2));

        Integer i3 = 200;
        Integer i4 = 200;
        System.out.println(i3 == i4);
        System.out.println(i3.equals(i4));

        System.out.println("---------------------------");

        Float f1 = 0.01f;
        Float f2 = 0.01f;
        System.out.println(f1 == f2);

        // https://blog.csdn.net/qq_43592352/article/details/128703958
        Long l1 = 123456789012345L + 30;
        // Long l2 = 2; // Long必须携带L
        long l3 = 2147483647;
        // long运算精度丢失
        long l4 = 2147483647 + 10;
        // Long l2 = 2147483648;
        System.out.println(l1);
        System.out.println(l4);
        // System.out.println(l1.equals(l2));

        System.out.println("---------------------------");

    }
}